package com.cy.controller;


import com.cy.common.ResultResponse;
import com.cy.entity.PopularCourses;
import com.cy.entity.Recommendations;
import com.cy.service.IRecommendationsService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  智能推荐控制层
 * </p>
 *
 * @author Aleven
 * @since 2024-12-21
 */
@RestController
@RequestMapping("/recommendations")
public class RecommendationsController {
    @Autowired
    private IRecommendationsService recommendationsService;
    @Operation(summary = "查找最热门的三个课程")
    @GetMapping("/findTopThreePopularCourses")
    public ResultResponse findTopThreePopularCourses() {
       List<PopularCourses> list= recommendationsService.findTopThreePopularCourses();
        return ResultResponse.success(list,list.size());
    }

}
